package com.nxn.core.web.tag;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.Validate;

/**
 * Represents the release element contents.
 * 
 * @author Michael Zhang
 */
public class Releases implements Serializable {
	private static final long serialVersionUID = 2138683304260670646L;
	
	private String javascript = null;
	private String stylesheet = null;
	private List<String> images = new ArrayList<String>();

	/**
	 * Returns the JavaScript file.
	 * 
	 * @return The String, may be null or empty.
	 */
	public String getJavaScript() {
		return javascript;
	}

	/**
	 * Sets the JavaScript file.
	 * 
	 * @param javascript
	 *            The JavaScript file.
	 */
	public void setJavascript(String javascript) {
		this.javascript = javascript;
	}

	/**
	 * Returns the StyleSheet file.
	 * 
	 * @return The String, may be null or empty.
	 */
	public String getStyleSheet() {
		return stylesheet;
	}

	/**
	 * Sets the StyleSheet file.
	 * 
	 * @param stylesheet
	 *            The StyleSheet file.
	 */
	public void setStylesheet(String stylesheet) {
		this.stylesheet = stylesheet;
	}

	/**
	 * Returns a Image files list.
	 * 
	 * @return The List, never be null.
	 */
	public List<String> getImages() {
		return images;
	}

	/**
	 * Adds a Image file into the list.
	 * 
	 * @param src
	 *            The file, can not be empty.
	 * 
	 * @throws IllegalArgumentException
	 *             Thrown when the "src" is empty.
	 */
	public void addImage(String src) throws IllegalArgumentException {
		Validate.notEmpty(src, "The 'src' is empty");

		images.add(src);
	}
}
